package com.study.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ctl
 * @date 2024-02-29
 */
@Component
@Slf4j
public class MqListener {
    @RabbitListener(queues = "simple.queue")
    public void listenerSimpleQueue(String msg) {
        log.info("请求成功获取的数据: {}",msg);
        System.out.println("接收到消息了：" + msg);
    }
}
